1. Field of the Invention
The present invention relates to a processor, a program, and a method for performing filter processing on an expanded image when images are expanded in the unit of blocks based on compressed image data which is compressed in JPEG (Joint Photographic Coding Experts Group) or MPEG (Moving Picture Experts Group) and so on, and particularly concerns an image processor, an image processing program, and an image processing method that can simplify filter processing and increase its speed when an image is decoded, and are suitable for an effective screen effect.
2. Description of the Related Art
JPEG has been widely known as compressing technique for a static image, and MPEG has been widely known as compressing technique for a moving image. In such image compressing methods, a block of 8×8 pixels is used as one unit and DCT (Discrete Cosine Transform) is performed. DCT is processing for decomposing an original image into spatial frequency components. An image can be compressed by reducing spatially redundant information.
Incidentally, when JPEG or MPEG is adopted, two kinds of noise is generated as will be discussed below and the noise deteriorates picture quality. Namely, in JPEG and MPEG, since a block of 8×8 pixels is used as a processing unit, in some images, a border of the block is observed as noise. This is because DCT is processing for removing some components corresponding to direct-current components from spatial frequency components of an image, the processing is performed for each block, and an average value of luminance is varied from block to block. Noise on the border is referred to as block noise.
Further, in DCT performed in JPEG and MPEG, harmonic components are removed as redundant information from spatial frequency components of an image. Thus, noise is generated on a part having a large luminance difference from the surrounding parts. In the case of large variations in luminance in a block, for example, when characters exist in the background of a natural picture, harmonic components are removed by DCT from data constituting an original border, resulting in blurred noise around the border. Such noise is referred to as mosquito noise.
Japanese Patent Laid-Open No. 3-46482 discloses technique for reducing block noise and mosquito noise. In the technique disclosed in the publication (hereinafter, referred to as a first conventional example), when border pixels positioned so as to interpose a border of adjacent blocks have a larger signal level difference than a first threshold value, and when a signal level difference between a border pixel and a pixel adjacent to the border pixel in the same block is smaller than a second threshold value regarding border pixels and pixels on arrays in blocks, filter processing is performed.
In this case, in FIG. 19, based on differences d0, d1, and d2 of signal levels S1, S0, S′0, and S′1 regarding pixel arrangements X1 and X0 and pixel arrangements X′0 and X′1 that are positioned on both sides of a block border, a signal level of the pixel arrangements X0 and X′0 is corrected. Namely, new signal levels S0-new and S′0-new are obtained by the equations shown below.S0-new=(S1+2·S0+S′0)/4S′0-new=(S0+2·S′0+S′1)/4
As another method for reducing block noise and mosquito noise, VM (Verification Model) concerning MPEG4 and technique disclosed in Japanese Patent Laid-Open No. 11-98505 (hereinafter, referred to as a second conventional example) have been known. In the second conventional example, it is judged whether vertical and horizontal block borders of FIG. 20 are in default mode or in DC offset mode, and processing is performed for each of the modes.
In this case, pixels sets S0, S1, and S2 are defined while block borders B1 and B2 are used as base points, and it is selectively determined whether a deblocking mode is the default mode or the DC offset mode according to a mode decision value based on a degree of block distortion phenomenon. And then, when the mode is judged as the default mode, four-point DCT kernel is used to find frequency information around the block borders of pixels. When the mode is judged as the DC offset mode in the mode decision step, it is judged whether the DC offset mode needs to be carried out, and block distortion phenomenon is removed if necessary.
However, in the first conventional example, since only the border pixels are corrected, distortion of blocks cannot be sufficiently removed. Further, in VM and the second conventional example, the processing is complicated and calculation load is too heavy.
Moreover, when such techniques are realized by hardware, since the processing is relatively complicated, it is difficult to reduce the size of a circuit. In view of miniaturization, it is desirable to simplify the processing as possible even if the picture quality is somewhat sacrificed. Additionally, since a mounted memory is limited in capacity, it is desirable to minimize a memory capacity occupied for computation in filter processing.